<?php
	$sql="select * from chuyenmuc where MaChuyenMuc=$MaCM";
	$dschuyenmuc = mysql_query($sql);
	$tenchuyenmuc=mysql_fetch_array($dschuyenmuc);
?>
	<?php
		// Lấy danh sách bài viết thuộc chủ đề
		$sql_baiviet_chuyenmuc = "SELECT  *
							  FROM baiviet B, loaichuyenmuc C
							  WHERE B.MaLoaiChuyenMuc = C.MaLoaiChuyenMuc AND C.MaChuyenMuc = $MaCM and B.XuatBan = 1 order by NgayDang DESC LIMIT 1";
		$danhsach_baiviet_chuyenmuc = mysql_query($sql_baiviet_chuyenmuc);
		
		while($dong_baiviet_chuyenmuc = mysql_fetch_array($danhsach_baiviet_chuyenmuc))
		{
			$HinhAnhPath = substr($dong_baiviet_chuyenmuc["HinhAnh"], 3);
			echo "<img width='100' hspace='10' align='left' src='{$HinhAnhPath}'>";
			echo "<h3>";
				echo "<a href='news.php?do=baivietchitiet&mbv={$dong_baiviet_chuyenmuc["MaBaiViet"]}'>{$dong_baiviet_chuyenmuc['TieuDe']}</a>";
			echo "</h3>";
			echo $dong_baiviet_chuyenmuc["TomTat"];
		}
	?>
